package kr.saeildamil.androidstudy.ch19;

import android.os.Handler;
import android.os.Message;

public class BackThread extends Thread {
	int mBackValue = 0;
	Handler mHandler;

	public BackThread(Handler mHandler) {
		super();
		this.mHandler = mHandler;
	}

	public void run() {
		super.run();
		while (true) {
			mBackValue++;
			Message msg = new Message();
			msg.what = 0;
			msg.arg1 = mBackValue;
			mHandler.sendMessage(msg);
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
